package magicloan.auctionpocket.ui.activity;

import android.view.View;
import android.widget.EditText;

import com.utils.module.StringUtils;
import com.utils.module.android.ToastUtil;

import magicloan.auctionpocket.R;
import magicloan.auctionpocket.ui.base.BaseActivity;

/**
 * Created by hechao on 2018/2/1.
 */
public class SettingNameActivity extends BaseActivity {

    private EditText mEtNickName ;
    private String mNickName ;

    @Override
    protected int setContentView() {
        return R.layout.ac_setting_name;
    }

    @Override
    protected void beforeInitView() {

    }

    @Override
    protected void afterInitView() {
        setTitle("修改昵称","提交");
        mEtNickName = (EditText) findViewById(R.id.et_nickname);
        mEtNickName.setText(StringUtils.isEmpty(instance.getNickName())?instance.getMobile():instance.getNickName());
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {

    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.tv_public_right:
                mNickName = mEtNickName.getText().toString().trim();
                if ( StringUtils.isEmpty(mNickName) ){
                    ToastUtil.showToast(mActivity,"昵称不能为空");
                }else{
                    ToastUtil.showToast(mActivity,"提交");
                }
                break;
        }
    }

}
